package ch.bfh.abcmmh.controller.operating.clock;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Observable;

import javax.swing.Timer;

public class Clock extends Observable {

	private Timer timer;

	public Clock(int delayMS) {
		this.timer = new Timer(delayMS, new ObserverNotifier());
		
	}	

	public Timer getTimer() {
		return timer;
	}



	private class ObserverNotifier implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent e) {

			setChanged();
			notifyObservers();
			clearChanged();
		}

	}
}